//2009/08/10 12:54:07
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class KiloMan
{
public:
    int hitsTaken(vector <int> pattern, string jumps)
    {
		int score = 0;
		for(int i=0; i<pattern.size(); i++)
		{
			if(jumps[i] == 'J' && pattern[i] > 2)
				score++;
			if(jumps[i] == 'S' && pattern[i] <= 2)
				score ++;
		}
		return score;
    }
};
